/*
 * Student.cpp
 *
 * Version: $Id: Student.cpp 63 2011-11-15 21:46:30Z s8376@pjwstk.edu.pl $
 */
#include <iostream>
#include <string.h>
#include "Student.h"

using namespace std;

Student::Student(char* forename, char* surname, char* pesel, char* index, int age, int semester, bool sex) :
    m_forename(strdup(forename)), m_surname(strdup(surname)),
            m_pesel(strdup(pesel)), m_index(strdup(index)), m_age(age),
            m_semester(semester), m_sex(sex)
{
}
Student::Student(Student& ob) :
    m_forename(strdup(ob.m_forename)), m_surname(strdup(ob.m_surname)),
            m_pesel(strdup(ob.m_pesel)), m_index(strdup(ob.m_index)),
            m_age(ob.m_age), m_semester(ob.m_semester), m_sex(ob.m_sex)
{
}
Student::~Student()
{
    delete[] m_forename;
    m_forename = 0;
    delete[] m_surname;
    m_surname = 0;
    delete[] m_pesel;
    m_pesel = 0;
    delete[] m_index;
    m_index = 0;
}
void Student::show()
{
    cout << "Param     :" << " " << endl;
    cout << "---------------------------------------------------" << endl;
    cout << "Surname   : " << m_surname << endl;
    cout << "Forename  : " << m_forename << endl;
    cout << "PESEL     : " << m_pesel << endl;
    cout << "Index     : " << m_index << endl;
    cout << "Age       : " << m_age << endl;
    cout << "Semester  : " << m_semester << endl;
    cout << "Sex       : " << (m_sex ? "Kobieta" : "Meżczyzna") << endl;

}
